<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	<style type="text/css">
		#hd{
			width: 500px;
			height: 300px;
			background: purple;
			margin: 10px auto;
		}
	</style>
<script type="text/javascript">
	
window.onload = function(){
	document.getElementById("hd").onclick = function(){
		alert('你好');
	}
}
	
	
</script>
	</head>
	<body>
		
		<div id="hd"></div>
		
	</body>
</html>
